# -*- encoding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _

from modulo.page.models import Section

class Streaming(models.Model):
    section = models.ForeignKey(Section, related_name="stream",
                                limit_choices_to = {'app': 'streaming'},
                                help_text=_(u"Selection de la rubrique contenant ce flux."), unique=True)

    id_ustream  = models.IntegerField(_(u'uStream ID'), help_text=_(u"Exemple: 4196256"))

    def get_absolute_url(self):
        return u'%s' % (self.section.get_absolute_url())
        
    def __unicode__(self):
        return u"%s" % (self.section)

    class Meta:
        verbose_name = _("stream")
